<?php include($folder.'/layouts/templates/pickup/header.tpl') ?>
<?php include($folder.'/layouts/templates/pickup/middle.tpl') ?>
<?php if ($_SESSION['id'] !== null): ?>
<?php
switch ((int)$_GET['hivo'])
{
	case 1:
		$action = 'add_pictures_to_gallery';
		break;
	case 2:
		$action = 'add_pictures_to_main_page';
		break;
}
?>
<?php echo extendedTable(array(
	'header' => 
		'<table cellpadding="0" cellspacing="0" style="width:100%"><tr><td style="width:100%">'.
		paginator(array(
			'subId' => 'paginator1',
			'itemsPerPageAll' => array(4,8,12,24,48,96),
			'itemsPerPage' => 12,
			'parameters' => null,
			'selectCountMethod' => 'pictures_select_count',
			'id' => 'picturePickup')).
		'</td><td style="white-space:nowrap"><input type="submit" value="Hozzáadás" class="button" name="submitaction_'.$action.'" />&nbsp;'.
		'<input type="button" value="Bezárás" class="button" onclick="javascript:window.opener.SubmitFormNoAction(); window.close();" /></td></tr></table>',
	'body' => dataList(array(
		'columnCount' => 4,
		'cellTemplate' => '<table>
			<tr>
				<td>
					<label for="picture{id}">
					<img src="'.$prefix.'/kep-kicsi?id={id}" id="image{id}" />
					</label>
				</td>
			</tr>
			<tr>
				<td>
					<center>
					<input type="checkbox" name="main[picture_id][]" value="{id}" id="picture{id}" />
					</center>
				</td>
			</tr>
		</table>',
		'id' => 'picturePickup',
		'parameters' => null,
		'itemsPerPage' => 12,
		'selectMethod' => 'pictures_select')),
	'footer' => paginator(array(
		'subId' => 'paginator2',
		'isFirst' => false,
		'itemsPerPageAll' => array(4,8,12,24,48,96),
		'itemsPerPage' => 12,
		'parameters' => null,
		'selectCountMethod' => 'pictures_select_count',
		'id' => 'picturePickup')))) ?>
<?php /*				</td>
			</tr>
			<tr>
				<td>Szöveg:</td>
			</tr>
			<tr>
				<td>
					<?php echo inputText(array(
						'dataBinding' => 'main',
						'dataField' => 'text',
						'attributes' => 'style="width:300px"')) ?>
				</td>
			</tr>
		</table>
</body>
</html> */ ?>
<?php endif; ?>
<?php include($folder.'/layouts/templates/pickup/footer.tpl') ?>